package com.dkm.orproject.dkmoa.dao;

import org.apache.ibatis.annotations.Mapper;
import com.dkm.orproject.dkmoa.domain.OaEntryFlow;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OaEntryFlowMapper {
    int deleteByPrimaryKey(Long pkEntryId);

    int insert(OaEntryFlow record);

    int insertSelective(OaEntryFlow record);

    OaEntryFlow selectByPrimaryKey(Long pkEntryId);

    int updateByPrimaryKeySelective(OaEntryFlow record);

    int updateByPrimaryKey(OaEntryFlow record);

    /**
     * 分页查询
     *
     * @param entryFlow
     * @param startTime
     * @param endTime
     * @param personnelId
     * @return
     */
    List<OaEntryFlow> findAll(@Param("entryFlow") OaEntryFlow entryFlow, @Param("startDate") String startTime, @Param("endDate") String endTime, @Param("personnelId") Long personnelId);

    /**
     * 总行数
     *
     * @param entryFlow
     * @param startTime
     * @param endTime
     * @param personnelId
     * @return
     */
    Long rowCount(@Param("entryFlow") OaEntryFlow entryFlow, @Param("startDate") String startTime, @Param("endDate") String endTime, @Param("personnelId") Long personnelId);

    /**
     * 批量删除
     *
     * @param list
     * @return
     */
    int deleteAll(@Param("list") List<Long> list);

    /**
     * id查询所有
     *
     * @param list
     * @return
     */
    List<OaEntryFlow> selectAll(@Param("list") List<Long> list);

    /**
     * 根据创建人查询
     *
     * @param pkPersonnelId
     * @return
     */
    OaEntryFlow selectCreatedBy(Long pkPersonnelId);

    Long getThisRecord(@Param("pkPersonnelId") Long pkPersonnelId);

    OaEntryFlow findByPersonnelId(@Param("pkPersonnelId") Long personnelId);
}